<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePermissionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('permissions', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->text('routes')->comment('路由别名，逗号分隔');
            $table->string('name', 50)->unique()->comment('名称');
            $table->timestamps();
            $table->softDeletes();
            $table->charset = 'utf8mb4';
            $table->engine = 'InnoDB';
            $table->autoIncrement = 1;
            $table->comment = 'permission权限组';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('permissions');
    }
}
